package com.yanjiali.controller;

import com.yanjiali.model.R;
import com.yanjiali.service.ArticleLikeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Package: com.yanjiali.controller
 * @Author: yanjiali
 * @Created: 2025/4/25 23:55
 */
@Api(tags = "文章点赞控制器")
@RestController
@RequestMapping("/v1/articleLikes")
public class ArticleLikeController {

    @Autowired
    private ArticleLikeService articleLikeService;

    @GetMapping("/isLikedArticle")
    @ApiOperation("判断当前登录用户是否点赞该文章")
    public R<Boolean> isLikedArticle(@RequestParam Long articleId) {
        return articleLikeService.isLikedArticle(articleId);
    }
}
